Face detection device, imaging apparatus and face detection method

ABSTRACT

A face detection device for detecting the face of a person in an input image may include the following elements: a face detection circuit including a hardware circuit configured to detect a face in an input image; a signal processing circuit configured to perform signal processing based on an input image signal in accordance with a rewritable program including a face detection program for detecting a face in an input image; and a controller configured to allow the face detection circuit and the signal processing circuit to perform face detection on an image of a frame or on respective images of adjacent frames among consecutive frames, and to control face detection by the signal processing circuit on the basis of a face detection result obtained by the face detection circuit.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.11/888,322, filed Jul. 31, 2007, which claims priority from JapanesePatent Application No. JP 2006-212841 filed in the Japanese PatentOffice on Aug. 4, 2006, the entire contents of which are incorporatedherein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a face detection device configured todetect the face of a person in an input image, an imaging apparatusincluding the function of the face detection device, and a facedetection method.

2. Description of the Related Art

In recent years, the use of digital imaging apparatuses includingdigital still cameras and digital video cameras has been rapidlyincreasing, and these apparatuses are becoming more sophisticated. Thishas been resulted in a growing demand for more advanced functions to beincluded in these apparatuses, whereby the commercial value thereof canbe enhanced. An exemplary advanced function that has been the focus inthis field is the technique of detecting a specific object in an image.

A representative technique of detecting an object is the technique ofdetecting the face of a person. With this face detection technique, aface area of a person can be extracted from a captured image, and theextraction result may be applied to various applications in the imagingapparatus or may be recorded as accompanying data of the image.

A known exemplary face detection technique involves conversion ofcaptured image data into luminance data, hue data, and chroma data, anddetection of a face area of a person on the basis of a change inluminance in the vertical direction in a skin-color area based on theluminance data and a spatial pixel distribution of skin-color pixelsbased on the three attribute data (for example, see Japanese Patent No.3561985, paragraphs [0038] to [0058], FIG. 1). Another known exemplarytechnique involves detection of a skin-color area and face featurepoints, such as the eyes and the mouth, in a captured image anddetermination of whether the skin-color area is the face of a person onthe basis of the positions of the feature points (for example, seeJapanese Unexamined Patent Application Publication No. 2004-5384,paragraphs [0018] and [0019], FIG. 1). Yet another known exemplarytechnique that does not particularly use color information involves thematching of a captured image with a face template image using luminancedata of the captured image and, in the case where a correlation valuebetween the two images is sufficiently high, it is determined that thecaptured image is an image of a face (for example, see JapaneseUnexamined Patent Application Publication No. 2003-271933, paragraphs[0046] to [0055], FIG. 6).

SUMMARY OF THE INVENTION

Various face detection algorithms are available, as has been describedabove. The following two points may be important in applying these facedetection techniques to imaging apparatuses, regardless of whether amoving image or a still image is recorded. The first important point isthe ability to satisfy both the high speed of tracking the motion of anobject and the motion of an imaging apparatus itself and the highdetection accuracy whereby errors or omissions in detection can beavoided. The second important point is the flexibility or adaptabilityto diverse detection algorithms and imaging conditions.

Face detection may be performed by software or dedicated hardware. Ingeneral, face detection performed by software often fails to achieve thehigh processing speed. For example, the software may fail to closelytrack the processing of a monitoring image in a still-image recordingmode or the recording of a moving image. The higher the detectionaccuracy demanded, the higher the processing load. This results indifficulty in implementing the practical detection rate in the imagingapparatus. That is, as has been described in the first important point,it may be very difficult to satisfy both the high speed and the highdetection accuracy.

In contrast, face detection performed by dedicated hardware is generallyknown to greatly improve the processing speed and the detectionaccuracy, as compared with software. However, as has been mentioned inthe second important point, the hardware may have difficulty in adaptingto diverse algorithms and imaging conditions or improving the detectionperformance. The hardware may have limited flexibility or adaptabilityin terms of detection performance.

It is desirable to provide a widely applicable face detection device, animaging apparatus, and a face detection method that satisfy both thehigh speed and the accuracy of face detection.

According to an embodiment of the present invention, there is provided aface detection device for detecting the face of a person in an inputimage, which may include the following elements: a face detectioncircuit including a hardware circuit configured to detect a face in aninput image; a signal processing circuit configured to perform signalprocessing based on an input image signal in accordance with arewritable program including a face detection program for detecting aface in an input image; and a controller configured to allow the facedetection circuit and the signal processing circuit to perform facedetection on an image of a frame or on respective images of adjacentframes among consecutive frames, and to control face detection by thesignal processing circuit on the basis of a face detection resultobtained by the face detection circuit.

In such a face detection device, a face detection circuit including ahardware circuit configured to detect a face in an input image may beprovided, and a signal processing circuit configured to perform signalprocessing based on an input image signal in accordance with arewritable program may be provided. By executing a face detectionprogram by the signal processing circuit, the signal processing circuitmay also perform face detection. A controller may allow the facedetection circuit and the signal processing circuit to perform facedetection on an image of a frame or on respective images of adjacentframes among consecutive frames, and to control face detection by thesignal processing circuit on the basis of a face detection resultobtained by the face detection circuit.

According to the face detection device of the embodiment of the presentinvention, since the face detection circuit may include the hardwarecircuit configured to perform face detection, the face detection by theface detection circuit can be performed quickly. By controlling the facedetection performed by the signal processing circuit on the basis of thedetection result obtained by the face detection circuit, the overallface detection accuracy can be improved. Since the face detectionperformed by the signal processing circuit may be controlled on thebasis of the face detection result obtained by the face detectioncircuit, the face detection performed by the signal processing circuitmay become more efficient, thereby improving the face detection accuracywhile reducing the processing time. By changing a program to be executedby the signal processing circuit, various face detection algorithms andprocesses other than the face detection process can be performed by thesignal processing circuit. Accordingly, the flexibility or adaptabilityto specification changes or feature expansion of a product can beenhanced. Therefore, both the high processing speed and the highaccuracy in face detection can be achieved, and a face detection devicethat can be applied to a wide variety of applications can beimplemented.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of the configuration of main elements of animaging apparatus according to an embodiment of the present invention;

FIG. 2 is a block diagram of an exemplary internal configuration of aface detection circuit;

FIG. 3 is a flowchart of a basic face detection process performed by theface detection circuit;

FIGS. 4A to 4C illustrate the relationship between the angle of view atthe time an image is captured and a face search angle;

FIG. 5 illustrates an exemplary definition of a face search angle;

FIG. 6 is a block diagram of an exemplary internal configuration of aprogrammable signal processing circuit;

FIG. 7 is a diagram of the outline of a first face detection process;

FIG. 8 is a flowchart of the first face detection process performed inthe imaging apparatus;

FIG. 9 is a diagram of the outline of a second face detection process;

FIG. 10 is a flowchart of the second face detection process performed inthe imaging apparatus;

FIG. 11 is a diagram of the outline of a third face detection process;

FIG. 12 is a flowchart of the third face detection process performed inthe imaging apparatus;

FIG. 13 is a diagram of the outline of a fourth face detection process;

FIG. 14 is a flowchart of the fourth face detection process performed inthe imaging apparatus; and

FIG. 15 is a block diagram of the configuration of an imagerecording/reproducing apparatus according to another embodiment of thepresent invention.

DETAILED DESCRIPTION

Exemplary embodiments of the present invention will now herein bedescribed in detail below.

FIG. 1 is a block diagram of the configuration of main elements of animaging apparatus according to an embodiment of the present invention.In FIG. 1, solid arrows indicate paths of image data; dotted arrowsindicate paths of control data; and broken arrows indicate paths of dataindicating a face detection result, which is part of the control data.

The imaging apparatus shown in FIG. 1 is implemented as a digital stillcamera, a digital video camera, or the like. The imaging apparatusincludes an optical block 11, an image sensor 12, a camera-signalprocessing circuit 13, a face detection circuit 14, a programmablesignal processing circuit 15, a display processing circuit 16, an imagecompression/decompression circuit 17, a storage unit 18, an image randomaccess memory (RAM) 19, an image bus 20, a central processing unit (CPU)21, an electrically erasable programmable read-only memory (EEPROM) 22,a RAM 23, and a gravity-direction sensor 24.

The optical block 11 includes a lens configured to focus light reflectedfrom an object to the image sensor 12, a drive mechanism configured tomove the lens to adjust the focus or to zoom in/out, a shuttermechanism, an iris mechanism, and the like. These drive mechanismscontained in the optical block 11 are driven in accordance with acontrol signal from the CPU 21. The image sensor 12 is, for example, asolid-state image pickup device, such as a charge-coupled device (CCD)or a complementary metal oxide semiconductor (CMOS), and convertsincident light from the object into an electrical signal.

The camera-signal processing circuit 13 is a block configured to applyvarious signal processes to an image signal output from the image sensor12. More specifically, for example, the block includes the function ofconverting an image signal from the image sensor 12 into digital data,various detection functions for the digital image data, and variousimage-quality correction functions for the image data. Detectioninformation from the camera-signal processing circuit 13 is supplied tothe CPU 21. On the basis of the detection information, the CPU 21calculates control values for auto-focus (AF) processing, auto-exposure(AE) processing, and the image-quality correction functions in thecamera-signal processing circuit 13. The image-quality correctionfunctions in the camera-signal processing circuit 13 include a gaincorrection function, a white-balance adjustment function, and the like.

The face detection circuit 14 is dedicated hardware configured to detectthe face of a person in an input image. The face detection circuit 14receives image data output from the camera-signal processing circuit 13via the image RAM 19, detects an area where the face of a person exists,and supplies the detection result to the CPU 21.

The programmable signal processing circuit 15 is a block configured toapply signal processes to image data read from the image RAM 19. Theprogrammable signal processing circuit 15 can perform a plurality oftypes of signal processes by reading programs from the CPU 21.Specifically in the embodiment, the programmable signal processingcircuit 15 is configured to execute a program for detecting the face ofa person in an input image. That is, both the face detection circuit 14and the programmable signal processing circuit 15 have the facedetection function.

The display processing circuit 16 receives image data output from thecamera-signal processing circuit 13 and the imagecompression/decompression circuit 17 via the image RAM 19, converts theimage data into an image signal to be displayed, and supplies the imagesignal to a monitor (not shown) including, for example, a liquid crystaldisplay (LCD).

The image compression/decompression circuit 17 receives image dataoutput from the camera-signal processing circuit 13 via the image RAM19, compresses/encodes the image data, and outputs thecompressed/encoded image data as a data file including a moving image ora still image to the storage unit 18. The imagecompression/decompression circuit 17 decompresses/decodes an image datafile read from the storage unit 18 and supplies the decompressed/decodedimage data to the display processing circuit 16 via the image RAM 19.For example, the Moving Picture Experts Group (MPEG) standard may beemployed as an encoding standard for moving images, and the JointPhotographic Experts Group (JPEG) standard may be employed as anencoding standard for still images.

The storage unit 18 is a unit configured to store image files encodedand generated by the image compression/decompression circuit 17. Thestorage unit 18 may be implemented as, for example, a drive device for amobile recording medium, such as a magnetic tape or an optical disc, ormay be implemented as a hard disk drive (HDD). Besides reading out astored image data file to the image compression/decompression circuit17, the storage unit 18 can supply information accompanying the datafile to the CPU 21.

The image RAM 19 is connected via the image bus 20 to the camera-signalprocessing circuit 13, the face detection circuit 14, the programmablesignal processing circuit 15, the display processing circuit 16, and theimage compression/decompression circuit 17. The image RAM 19 is sharedby these connected processing blocks, and image data is transferredbetween and among these blocks via the image RAM 19.

In the embodiment, these processing blocks have been described astransferring image data via the image RAM 19. However, for example, theface detection circuit 14 and the display processing circuit 16 may beconfigured to directly receive image data output from the camera-signalprocessing circuit 13 and the image compression/decompression circuit 17without the image data passing through the image bus 20.

The CPU 21 is a block configured to control the overall imagingapparatus. The CPU 21 reads and executes programs stored in the EEPROM22 to implement such control. Programs executed by the CPU 21 and theprogrammable signal processing circuit 15, and various data such ascontrol data selected at the time the programs are executed are storedin advance in the EEPROM 22. Data is temporarily stored in the RAM 23 atthe time the CPU 21 executes a program. For example, data including theface detection results obtained by the face detection circuit 14 and theprogrammable signal processing circuit 15 is stored in the RAM 23.

The gravity-direction sensor 24 detects the direction of gravitationalforce applied to the imaging apparatus and supplies the detection resultto the CPU 21. On the basis of the detection result, the CPU 21 candetermine the direction in which the imaging apparatus is tilted.

The basic operation of the imaging apparatus will now herein bedescribed below. At the time of recording an image, signals generated bythe image sensor 12 performing reception of light and photoelectricconversion are sequentially supplied to the camera-signal processingcircuit 13, and the camera-signal processing circuit 13 applies digitalconversion and image-quality correction to the signals. The processedimage data passes through the image bus 20 and is temporality stored inthe image RAM 19. The display processing circuit 16 receives the imagedata from the camera-signal processing circuit 13 via the image RAM 19,generates an image signal to be displayed, and supplies the image signalto the monitor (not shown). Accordingly, the image currently beingcaptured (camera-through image) is displayed on the monitor, and aperson who is capturing this image can view the image and check theangle of view.

The image compression/decompression circuit 17 sequentially receivespieces of output image data supplied from the camera-signal processingcircuit 13 via the image RAM 19, compresses/encodes the image data togenerate a moving image file, and records the moving image file in thestorage unit 18. In response to pressing a shutter release button (notshown) or the like, one frame of image data from the camera-signalprocessing circuit 13 is compressed/encoded by the imagecompression/decompression circuit 17 to generate a still image file, andthe still image file can be recorded in the storage unit 18.

The image file stored in the storage unit 18 is read to the imagecompression/decompression circuit 17, and the imagecompression/decompression circuit 17 decompresses/decodes the imagefile, and supplies the decompressed/decoded image data to the displayprocessing circuit 16. The display processing circuit 16 converts theimage data into a signal to be displayed. Accordingly, a moving image ora still image can be reproduced and displayed on the monitor.

At the time of recording an image, which has been described above, theface detection circuit 14 receives output image data from thecamera-signal processing circuit 13 via the image RAM 19 and performsface detection. The output image data from the camera-signal processingcircuit 13 is also supplied to the programmable signal processingcircuit 15 via the image RAM 19, and the programmable signal processingcircuit 15 can perform face detection on the basis of the image data.The face detection results obtained by the face detection circuit 14 andthe programmable signal processing circuit 15 are supplied to the CPU21. As discussed below, the face detection circuit 14 and theprogrammable signal processing circuit 15 can receive the detectionresult obtained by the other circuit via the CPU 21 and further performface detection on the basis of the detection result received.

The CPU 21 obtains, for example, the final detection result on the basisof the detection results obtained by these processing blocks and usesthe final detection result to calculate control values for AE, AF,white-balance adjustment, and the like. For example, the CPU 21 adjuststhe aperture or the white balance gain so as to optimize the brightnessor color of the detected face, or adjusts the focus on the detectedface. Information of the face detection result (e.g., positionalinformation regarding a face area) may be recorded as accompanyinginformation of the image file in the storage unit 18.

At the time of reproducing an image file in the storage unit 18, each ofthe face detection circuit 14 and the programmable signal processingcircuit 15 may receive image data that has been decompressed/decoded bythe image compression/decompression circuit 17 via the image RAM 19 andperform face detection. In that case, face detection can be performed bythe processing blocks at the same time as the recording of an image. TheCPU 21 obtains the final detection result on the basis of the detectionresults obtained by the processing blocks and, for example, records thefinal detection result as accompanying information of the original imagefile. Alternatively, the CPU 21 updates the original accompanyinginformation. The detection result may be displayed, together with thereproduced image, on the monitor, or the detection result may berecorded in the EEPROM 22 for later use in other processes.

Next, face detection using the face detection circuit 14 and theprogrammable signal processing circuit 15 will now herein be describedin detail below.

FIG. 2 is a block diagram of an exemplary internal configuration of theface detection circuit 14.

The face detection circuit 14 is dedicated hardware configured toperform face detection, as has been described above. Referring to FIG.2, the face detection circuit 14 contains an enlargement/reductioncircuit 41, an image memory 42, a face detection core 43, and acontroller 44.

In the face detection circuit 14, the face detection core 43 is acircuit block configured to perform face detection. In the embodiment,the face detection core 43 performs matching between a face templateimage of a predetermined size and an input image and determines thepresence of a face on the basis of a correlation value. Theenlargement/reduction circuit 41 converts the size (the number of pixelsin the horizontal and vertical directions) of image data read from theimage RAM 19 via the image bus 20 so as to be compatible with facedetection by the face detection core 43. The image memory 42 temporarilystores the image data converted by the enlargement/reduction circuit 41,clips out an image of a predetermined size on the basis of a readaddress specified by the controller 44, and outputs the clipped image tothe face detection core 43. The clipped image data is written into theimage RAM 19 for later use.

The controller 44 controls the operation of the enlargement/reductioncircuit 41, the image memory 42, and the face detection core 43 on thebasis of face detection parameters supplied from the CPU 21. Forexample, the controller 44 outputs an image-data enlargement/reductionrate to the enlargement/reduction circuit 41, a write/read memoryaddress to the image memory 42, and a control value specifying the facesearch direction or the like to the face detection core 43.

FIG. 3 is a flowchart of a basic face detection process performed by theface detection circuit 14. In step S11, the CPU 21 sets face detectionparameters for the controller 44 in the face detection circuit 14. Inaccordance with the setting of the face detection parameters, thecontroller 44 controls the operation from step S12 onward.

In step S12, the controller 44 sets an image enlargement/reduction ratefor the enlargement/reduction circuit 41. The enlargement/reductioncircuit 41 reads, from the image RAM 19, for example, only one frame ofimage data which has been output from the camera-signal processingcircuit 13 and recorded in the image RAM 19, converts the image size inaccordance with the setting entered from the controller 44, andtemporarily records the size-converted image data in the image memory42.

In order to reduce the space used in the image memory 42, only apredetermined area of the above-mentioned one-frame image in the imageRAM 19 may be read. In that case, the image data is repeatedly read inunits of predetermined areas until the entire image data is read. Everytime data is read, the processing in steps S12 to S18 is repeated.

In step S13, the image memory 42 clips out an area of a predeterminedsize as a face window from the size-converted image recorded in step S12in accordance with the read address specified from the controller 44 andoutputs the face window to the face detection core 43.

The processing in steps S12 and S13 is intended to make a face areapossibly existing in the image read from the image RAM 19 coincide thesize of a face template used in face detection by the face detectioncore 43. That is, the face detection core 43 stores a face template of apredetermined size in an internal memory. The image memory 42 clips outan area of the same size as that of the face template from the recordedimage.

In step S14, the face detection core 43 performs the matching betweenthe face window supplied from the image memory 42 and many facetemplates stored in the face detection core 43 and calculates acorrelation value therebetween.

In step S15, the face detection core 43 determines whether an image inthe face window is a face by determining whether each of the correlationvalues calculated in step S14 is sufficiently high. For example, theface determination is made by determining whether the maximum value ofthe calculated correlation values exceeds a predetermined threshold.

In the case where the face detection core 43 determines in step S15 thatthe image in the face window is a face, the face detection core 43performs the processing in step S17. Otherwise, the face detection core43 performs the processing in step S18.

In step S17, the face detection core 43 temporarily stores the facedetection result in the internal memory and temporarily holds the facedetection result. An exemplary face detection result includesinformation regarding a face area (e.g., the coordinates of a referenceposition in the image and the size in the horizontal and verticaldirections relative to the reference position), the direction in whichthe face is pointing, the tilt angle of the face, the angle of view atthe time the image has been captured, an evaluation value indicating the“faceness” (e.g., an evaluation value based on the above-mentionedcorrelation value), and an enlargement/reduction rate employed in theenlargement/reduction circuit 41 at the time the face has been detected.

In step S18, the controller 44 determines whether the last face windowhas already been clipped out from the image stored in the image memory42. In the case that the last face window has not been clipped out yet,the controller 44 changes the position to clip out a face window andperforms the processing in step S13. In the case that the last facewindow has been clipped out, the controller 44 performs the processingin step S19.

In step S19, the controller 44 determines whether to perform the facedetection again by changing the size of a face to be detected on thebasis of the face detection parameters set by the CPU 21. In the casethat the controller 44 does not perform the detection again, thecontroller 44 proceeds to step S20. In the case that the controller 44determines to perform the detection again, the controller 44 returns tostep S12 and implements control so as to re-read the same image from theimage RAM 19. At this point, the enlargement/reduction rate set for theenlargement/reduction circuit 41 is changed, and hence a face of adifferent size in the input image can be detected.

In step S20, the face detection core 43 outputs the face detectionresult held in step S17 to the CPU 21.

An additional description concerning the setting of the face detectionparameters in step S11 will now be given.

The detection accuracy and the detection speed of the face detectioncircuit 14 can be changed in accordance with the face detectionparameters set for the face detection circuit 14 by the CPU 21. Forexample, faces of any size can be detected in the same input image bychanging the enlargement/reduction rate to various rates in theenlargement/reduction circuit 41. As a result, the detection accuracy isimproved. In contrast, the processing speed becomes slower. Thedetection accuracy and the processing speed change depending on thenumber of face templates used in the face detection core 43. Forexample, the detection accuracy can be improved by performing thematching using face templates having different face directions and tiltangles.

The controller 44 can specify the face search direction (search angle)in the face detection core 43 in accordance with the face detectionparameters set by the CPU 21. Face detection in accordance with the facesearch direction will now be described using FIGS. 4A to 4C and FIG. 5.

FIGS. 4A to 4C illustrate the relationship between the angle of view atthe time an image has been captured and a search angle. In FIGS. 4A to4C, dotted windows represent face windows corresponding to detectedfaces.

At the time of capturing moving images, recorded moving images aredisplayed on a general television monitor. Thus, the imaging apparatusis used in a predetermined direction at all times. A captured image willbe, as shown in FIG. 4A, an image with a horizontally long angle of viewin which a scanning reference point P×0 resides in the upper leftcorner. In contrast, at the time of capturing still images, the imagingapparatus is used at various tilt angles. Besides the angle of viewshown in FIG. 4A, other possible angles of view include, for example, asshown in FIG. 4B, a vertically long angle of view in which the imagingapparatus is tilted to the right so that the scanning reference pointP×0 resides in the upper right corner, and, as shown in FIG. 4C, avertically long angle of view in which the imaging apparatus is tiltedto the left so that the scanning reference point P×0 resides in thelower left corner. If the image is tilted at a different angle, so isthe direction of the face in the image. It is therefore necessary tocontrol the face search direction in implementing the face detection.The controller 44 in the face detection circuit 14 can set the facesearch angle for the face detection core 43 in accordance with the facedetection parameters set by the CPU 21.

FIG. 5 shows an exemplary definition of the face search angle.

For example, four types of face search angles, namely, 0°, +90°, −90°,and 180°, can be set for the face detection core 43, as shown in FIG. 5.In this definition, the face search angle at the angle of view shown inFIG. 4A is 0° serving as the reference; and −90° corresponds to the facesearch angle at the angle of view shown in FIG. 4B, and +90° correspondsto the face search angle at the angle of view shown in FIG. 4C.

The imaging apparatus according to the embodiment has thegravity-direction sensor 24. In accordance with a detection signal fromthe gravity-direction sensor 24, the CPU can automatically determine thetilt of the imaging apparatus at the time an image has been capturedand, on the basis of the tilt, set the above-mentioned face search angleas a face detection parameter for the face detection circuit 14.

Alternatively, a user may enter the tilt at the time an image has beencaptured using input keys or the like, and the CPU 21 may set the searchangle on the basis of the information entered. Alternatively, thefrequency of a search direction occurring based on search-angle settinghistory may be stored in the EEPROM 22, and the CPU 21 may read theabove-mentioned search direction frequency next time the CPU 21 performsface detection, based on which the CPU 21 may predict and set the searchangle. When detecting a face in an image reproduced from a still imagefile stored in the storage unit 18, in the case where tilt informationat the time the image has been captured is stored as accompanyinginformation of the still image file, the CPU 21 may set the search angleon the basis of the tilt information.

Further, one image may contain faces tilted at different angles.Therefore, when detecting a face(s) in one image, the CPU 21 may set aplurality of search angles in the face detection circuit 14, as shown inFIG. 5. This can reduce the number of omissions in face detection.

FIG. 6 is a block diagram of an exemplary internal configuration of theprogrammable signal processing circuit 15.

The programmable signal processing circuit 15 includes a RAM 51, digitalsignal processors (DSPs) 52 and 53, and a controller 54. The RAM 51temporarily stores image data read from the image RAM 19 and programssupplied from the controller 54. The DSPs 52 and 53 are signalprocessing modules configured to perform, for example, face detection byexecuting a program stored in the RAM 51. In the embodiment, the twoDSPs 52 and 53 are provided. The controller 54 controls the operation ofthe DSPs 52 and 53 in accordance with control information from the CPU21 and specifies a write/read address in the RAM 51.

In the programmable signal processing circuit 15, a program stored inthe EEPROM 22 is read by the CPU 21 and stored in the RAM 51 via thecontroller 54. At the same time, various control parameters are givenfrom the CPU 21 to the controller 54, and the controller 54 in turn setsthe parameters for the DSPs 52 and 53. In accordance with the details ofthe program and the control parameters, the programmable signalprocessing circuit 15 combines a plurality of arithmetic logic units(ALUs) to generate a command set for face detection and executes thecommand set. In other words, as the CPU 21 loads a new program, theprocessing content to be performed by the programmable signal processingcircuit 15 can be updated as necessary.

In the case where face detection is performed, image data read from theimage RAM 19 is temporarily stored in the RAM 51 and then loaded intothe DSPs 52 and 52 performing the face detection. At this time,information based on the face detection result obtained by the facedetection circuit 14 may be set by the CPU 21 as a control parameter forthe DSPs 52 and 53. The face detection results obtained by the DSPs 52and 53 are output to the CPU 21 via the controller 54.

The programmable signal processing circuit 15 may apply other signalprocesses, besides the face detection, to image data read from the imageRAM 19 in accordance with a program loaded by the CPU 21 to the RAM 51at the time of recording or reproducing an image. For example, theprogrammable signal processing circuit 15 may perform part of thedetection function and the image-quality correction function of thecamera-signal processing circuit 13. In this case, the detection resultis supplied to the CPU 21, and the image-quality-corrected image data istemporarily stored in the image RAM 19 and loaded into, for example, thedisplay processing circuit 16 or the image compression/decompressioncircuit 17. Alternatively, different processes may be performed inrecording and reproducing an image. Alternatively, the DSPs 52 and 53may perform different signal processes.

In the imaging apparatus with the above-described configuration, facedetection can be performed by both the face detection circuit 14 and theprogrammable signal processing circuit 15. Since the face detectioncircuit 14 is a hardware circuit dedicated to face detection, as hasbeen described above, it is difficult to greatly change the detectionprocedure, although the detection accuracy and the processing speed maybe changed in accordance with the setting of the face detectionparameters. In contrast, in the case of the programmable signalprocessing circuit 15, not only the detection setting, but also thedetection algorithm, for example, can be greatly changed in accordancewith a program loaded by the CPU 21. The programmable signal processingcircuit 15 is highly flexible to the detection accuracy or the like.However, in the case where, for example, the same detection algorithm isused to detect a face in the same image area with the same detectionaccuracy, the face detection circuit 14 can perform the face detectionmore quickly than the programmable signal processing circuit 15 can.

In the imaging apparatus according to the embodiment, face detectionthrough hardware using the face detection circuit 14 and face detectionthrough software using the programmable signal processing circuit 15 areemployed, and the face detection results obtained by these blocks areappropriately combined, thereby outputting the final detection resultfrom the CPU 21. As discussed below, a detection algorithm and facedetection parameters mainly focusing on the detection speed rather thanthe detection accuracy are employed in the face detection circuit 14. Incontrast, a detection algorithm and face detection parameters mainlyfocusing on the detection accuracy rather than the detection speed areemployed in the programmable signal processing circuit 15. For example,the parameter setting may be more detailed in the programmable signalprocessing circuit 15 than in the face detection circuit 14, or theprogrammable signal processing circuit 15 may be configured to detect aface with a specific feature, which is difficult to be detected by theface detection circuit 14. Face detection processes are appropriatelyperformed by the face detection circuit 14 and the programmable signalprocessing circuit 15 in a serial or parallel manner. If necessary, facedetection parameters of one circuit may be set on the basis of thedetection result obtained by the other circuit.

With the operation described above, advantages of both hardware andsoftware are merged to achieve both the processing speed and the facedetection accuracy as best as possible. Using the same circuitconfiguration including the face detection circuit 14 and theprogrammable signal processing circuit 15, the flexibility to modelchanges and feature expansion of the imaging apparatus can be enhanced,thereby suppressing the development and production cost over a longperiod of time.

The following description concerns specific examples of face detectionusing both the face detection circuit 14 and the programmable signalprocessing circuit 15.

First Face Detection Process

FIG. 7 is a diagram of the outline of a first face detection process.

In the first face detection process shown in FIG. 7, the face detectioncircuit 14 performs high-speed face detection on the entirety of aninput image P1 (step S101). The programmable signal processing circuit15 performs face detection with higher accuracy on a partial area of theinput image P1 on the basis of the detection result obtained by the facedetection circuit 14 (step S102). The CPU 21 outputs the final detectionresult on the basis of the detection results obtained by these blocks.

More specifically, the face detection circuit 14 allows some detectionerrors and detects the rough position and size of a face area in theentire input image such that at least omissions in face detection can beavoided. That is, the face detection circuit 14 gives priority to thedetection speed over the detection accuracy. FIG. 7 shows that, with theabove-described detection process performed by the face detectioncircuit 14, face areas A11 to A15 are detected in the input image P1. Aface is also detected even in areas where a face does not exist (theface areas A14 and A15).

In contrast, a processing program and face detection parameters are setfor the programmable signal processing circuit 15 such that face areascan be detected more accurately than by the face detection circuit 14.The programmable signal processing circuit 15 can detect the accurateposition and size of a face area. In addition, detection errors are morereliably avoided in the programmable signal processing circuit 15 thanin the face detection circuit 14. In this case, the CPU 21 places alimit to face detection areas in the programmable signal processingcircuit 15 on the basis of the result of detecting face areas by therough detection processing by the face detection circuit 14 (e.g., thecoordinates and size of face areas). Accordingly, the programmablesignal processing circuit 15 can achieve both the high accuracy and thereduced processing time.

In the example shown in FIG. 7, on the basis of the face detectionresult obtained in the input image P1 by the programmable signalprocessing circuit 15, face areas A16 to A18 corresponding to the faceareas A11 to A13, respectively, are detected as face areas. The faceareas A14 and A15, which have been mistakenly detected as face areas,are deleted from the detection result. Thus, the presence of each faceand its existing area are more accurately detected.

The programmable signal processing circuit 15 outputs the accuratecoordinates and size of each face area as the face detection resultobtained by such processing to the CPU 21. Besides the coordinates andsize of each face area, more detailed parameters, such as the directionof a detected face, the tilt of the face, an evaluation value of the“faceness” (e.g., information regarding a correlation value obtained bytemplate matching), and detection error information indicating, of thedetection result obtained by the face detection circuit 14, an areawhere a face does not exist, may be detected and output to the CPU 21.In the example shown in FIG. 7, the direction of a face is indicated byan arrow in the face area A16, and the tilt of a face is indicated by adotted-chain line in the face area A18.

The CPU 21 obtains the final detection result on the basis of theabove-mentioned detection result obtained by the programmable signalprocessing circuit 15 and uses the final detection result for othercontrol processing including AE and AF. That is, the programmable signalprocessing circuit 15 can output various highly accurate detectionresults within a minimum processing time in accordance with thespecification of a program loaded and the parameters set by the CPU 21.Therefore, the detection results can be flexibly applied to a widervariety of applications.

The CPU 21 can also recalculate and set face detection parameters forthe face detection circuit 14 on the basis of the accurate detectionresult obtained by the programmable signal processing circuit 15.

In the first face detection process, as shown in FIG. 7, it ispreferable that the face detection circuit 14 and the programmablesignal processing circuit 15 perform face detection on the basis of dataof the same input image P1. In the actual processing, however, theprogrammable signal processing circuit 15 may perform face detection onan image delayed for one or a few frames with respect to an imagedetected by the face detection circuit 14.

FIG. 8 is a flowchart of the first face detection process performed inthe imaging apparatus. In step S111, the CPU 21 sets face detectionparameters for the face detection circuit 14.

In step S112, the controller 44 in the face detection circuit 14controls the enlargement/reduction circuit 41, the image memory 42, andthe face detection core 43 on the basis of the face detection parametersset by the CPU 21 to perform high-speed detection processing fordetecting a rough face area on the basis of one frame of image data,which is sequentially read from the image RAM 19 on a frame-by-framebasis.

After the face detection is completed by the face detection circuit 14,the face detection core 43 outputs the face detection result (e.g., thecoordinates and size of a face area) to the CPU 21 in step S113. In stepS114, the CPU 21 sets face detection parameters for the programmablesignal processing circuit 15 on the basis of the detection resultsupplied from the face detection circuit 14. For example, the CPU 21sets such face detection parameters for the programmable signalprocessing circuit 15 that only the face area detected by the facedetection circuit 14 and the surrounding area thereof can serve as aface search range. Before performing step S111, the CPU 21 loads inadvance a necessary face detection program to the RAM 51 in theprogrammable signal processing circuit 15.

In step S115, the controller 54 in the programmable signal processingcircuit 15 transfers, of image data read from the image RAM 19, datacorresponding to the face area detected by the face detection circuit 14and the surrounding area thereof to the DSPs 52 and 53 (or one of theDSPs 52 and 53) on the basis of the face detection parameters set by theCPU 21, and allows the DSPs 52 and 53 to perform face detection focusingon the detection accuracy.

In step S116, the controller 54 in the programmable signal processingcircuit 15 receives the face detection results from the DSPs 52 and 53and outputs the face detection results to the CPU 21. In step S117, theCPU 21 generates the final face detection result on the basis of theface detection result obtained by the programmable signal processingcircuit 15.

The processing in steps S114 to S116 may be performed only in the casewhere a face has been detected by the face detection circuit 14. In stepS118, the CPU 21 determines whether to end the face detection process.In the case where the CPU 21 determines not to end the face detectionprocess, the CPU 21 performs the processing in step S119.

In step S119, the CPU 21 recalculates face detection parameters for theface detection circuit 14 on the basis of the face detection resultobtained by the programmable signal processing circuit 15. Thereafter,the flow returns to step S111, and the CPU 21 sets the recalculated facedetection parameters for the face detection circuit 14 and allows theface detection circuit 14 to start face detection on the next image.

The following procedure of recalculating face detection parameters maybe possible. For example, the face search range in the face detectioncircuit 14 is limited on the basis of the position and size of a facearea detected by the programmable signal processing circuit 15. In thiscase, the CPU 21 calculates a motion vector on the basis of informationregarding the direction of a face detected by the programmable signalprocessing circuit 15, and the face search range in the face detectioncircuit 14 may be specified on the basis of the vector motion.Information regarding the calculated motion vector may be recorded inthe storage unit 18 or output to an external device as accompanying dataof the corresponding image file.

On the basis of detection error information from the programmable signalprocessing circuit 15, a face area that has been mistakenly detected bythe face detection circuit 14 may be controlled not to be searched. Onthe basis of information regarding the direction and tilt of a facedetected by the programmable signal processing circuit 15, facetemplates to be used for determining the matching in the face detectioncircuit 14 may be controlled to be limited to those of great necessity.

In the above-described first face detection process, the face detectioncircuit 14 detects a rough face area so as to avoid omissions indetecting a face in the entire input image, and hence the face detectioncircuit 14 can perform high-speed face detection. Highly accurate facedetection is then performed by the programmable signal processingcircuit 15 using the surrounding area of a face area obtained by thedetection by the face detection circuit 14 as a face search range.Despite the fact that the programmable signal processing circuit 15 canaccurately detect a face area and correct the detection result obtainedby the face detection circuit 14, the face search range is limited, andhence the detection processing time is reduced. While maintaining thedetection accuracy equivalent to that in the case where the singleprogrammable signal processing circuit 15 alone performs face detection,the processing speed of the programmable signal processing circuit 15can be greatly increased. For example, using such a face detectionresult, AF control and adjustment of the image quality such as the whitebalance can be easily implemented with relatively low processing loadwhile tracking the detected face.

Since the face search range in the programmable signal processingcircuit 15 can be limited on the basis of the detection result obtainedby the face detection circuit 14, the programmable signal processingcircuit 15 can output various detection results including the directionand tilt of a face without increasing the processing time. Therefore,the detection results can be flexibly applied to a wider variety ofapplications.

By recalculating the face detection parameters set for the facedetection circuit 14 on the basis of the detection result obtained bythe programmable signal processing circuit 15, the processing in theface detection circuit 14 becomes more efficient and can be completedmore quickly. For example, within a predetermined time, only thesurrounding area of a face area detected by the programmable signalprocessing circuit 15 serves as a face search area in the next inputimage in the face detection circuit 14, thereby reducing the processingtime. In such a case, a certain degree of detection accuracy can bemaintained since adjacent input images are highly correlated with eachother.

Alternatively, the face detection performed by the face detectioncircuit 14 and the programmable signal processing circuit 15 in theabove-described procedure and the recalculation of face detectionparameters for the face detection circuit 14 may be selectivelyperformed in accordance with an operation mode set in the imagingapparatus.

For example, in the case of a still-image recording mode, the CPU 21displays an image that has been captured prior to a recording operationon a monitor. When a user is adjusting the angle of view, only the facedetection processing by the face detection circuit 14 in steps S112 andS113 is performed, and AE and AF control is implemented on the basis ofthe detection result. Accordingly, an image can be quickly displayed,though with less detection accuracy, and the power consumption duringthe detection can be suppressed. For example, when a shutter releasebutton is pressed halfway, the face detection processing by theprogrammable signal processing circuit 15 in steps S115 and S116 is alsoperformed, thereby performing accurate face detection. In the case of amoving-image recording mode, the recalculation of face detectionparameters for the face detection circuit 14 in step S119 is performed,for example, at predetermined time intervals, whereby the face detectionaccuracy can be maintained, while reducing the overall processing load.Accordingly, the image recording can be reliably performed at apredetermined frame rate.

Although the face detection by the face detection circuit 14 and theface detection by the programmable signal processing circuit 15 areperformed in a serial manner in the above-described flowchart, they canbe done in a parallel manner. For example, the face detection circuit 14can perform face detection on a frame-by-frame basis. In contrast, theprogrammable signal processing circuit 15 may not be able to completeface detection in a period of one frame. In such a case, informationregarding a rough face area detected by the face detection circuit 14 isoutput by the CPU 21 as a detection result every frame, and, using theaccurate face-area information output every few frames from theprogrammable signal processing circuit 15, the CPU 21 corrects thedetection result obtained by the face detection circuit 14. In theprogrammable signal processing circuit 15, only the face search rangemay be necessary to be specified on the basis of the most recentdetection result obtained by the face detection circuit 14. As in theprocessing in step S119 described above, the face detection parametersfor the face detection circuit 14 may be reset on the basis of thedetection result obtained by the programmable signal processing circuit15. With such processing, the result of detecting a face area can bereliably output on a frame-by-frame basis in the case of, for example,recording a moving image, and the accuracy of the detection result canthus be improved.

As another example of the case of parallel processing, the facedetection circuit 14 performs face detection, and the programmablesignal processing circuit 15 in turn performs face detection on an imageof the next frame on the basis of the detection result obtained by theface detection circuit 14. In this case, at the same time as theprogrammable signal processing circuit 15 performs face detection, theface detection circuit 14 starts performing face detection on the imageof the same frame. Alternatively, if the face detection circuit 14 cancomplete face detection more quickly than the programmable signalprocessing circuit 15 can, the face detection circuit 14 starts facedetection from the next frame onward so that the face detection will becompleted by the face detection circuit 14 at the same time as the facedetection performed by the programmable signal processing circuit 15ends. With such processing, the result of detecting a face area can bereliably output on a frame-by-frame basis, and the accuracy of thedetection result can thus be improved.

Second Face Detection Process

FIG. 9 is a diagram of the outline of a second face detection process.

In the second face detection process shown in FIG. 9, the face detectioncircuit 14 detects a face in the entirety of an input image P2 andoutputs information regarding an area including the entire face (stepS201). The programmable signal processing circuit 15 detects theposition and state (direction, tilt, shape, and the like) of parts inand around the face, such as the eyes, mouth, lip, nose, eyebrows, eyeglasses, mask, and the like (hereinafter simply referred to as “facialparts”) in the input image P2 (step S202). In this case, theprogrammable signal processing circuit 15 may employ, in the inputimage, only the face area detected by the face detection circuit 14 oran area including the surrounding area of the detected face area as asearch area for searching for facial parts, thereby reducing the timenecessary for detecting the parts.

The face detection circuit 14 may not only detect the coordinates andsize of a face, but also the direction and tilt of the face. By settingthese pieces of information as face detection parameters for theprogrammable signal processing circuit 15, the programmable signalprocessing circuit 15 is informed in advance of deviations in direction,tilt, and position of the facial parts, whereby the programmable signalprocessing circuit 15 can detect the parts more quickly and accurately.The programmable signal processing circuit 15 may output an evaluationvalue generated by evaluating the facial expression on the basis of theresult of detecting the position and state of the facial parts.

In the example shown in FIG. 9, with the detection process performed bythe face detection circuit 14, face areas A21 to A23 are detected in theinput image P2. The direction of a face is indicated by an arrow in theface area A21, and the tilt of a face is indicated by a dotted-chainline in the face area A23. Among these areas, in the face area A22, eyeareas A24 and A25 and a mouth area A26 are detected as facial parts bythe processing performed by the programmable signal processing circuit15.

As in the first face detection process, it is also preferable in thesecond face detection process that the face detection circuit 14 and theprogrammable signal processing circuit 15 perform detection of a faceand facial parts on the basis of data of the same input image P2. In theactual processing, however, the programmable signal processing circuit15 may perform detection on an image delayed for one or a few frameswith respect to an image detected by the face detection circuit 14.

FIG. 10 is a flowchart of the second face detection process performed inthe imaging apparatus. In step S211, the CPU 21 sets face detectionparameters for the face detection circuit 14.

In step S212, the controller 44 in the face detection circuit 14controls the enlargement/reduction circuit 41, the image memory 42, andthe face detection core 43 on the basis of the face detection parametersset by the CPU 21 to detect the entire face area on the basis of oneframe of image data, which is sequentially read from the image RAM 19 ona frame-by-frame basis.

After the face detection is completed by the face detection circuit 14,the face detection core 43 outputs the face detection result (e.g., thecoordinates, size, direction, and tilt of a face area) to the CPU 21 instep S213.

In step S214, the CPU 21 sets face detection parameters for theprogrammable signal processing circuit 15 on the basis of the detectionresult supplied from the face detection circuit 14. For example, the CPU21 sets such face detection parameters for the programmable signalprocessing circuit 15 that only the face area detected by the facedetection circuit 14 and the surrounding area thereof can serve as aface search range. In addition, the CPU 21 informs the programmablesignal processing circuit 15 of information regarding the direction andtilt of the face.

In step S215, the controller 54 in the programmable signal processingcircuit 15 transfers, of image data read from the image RAM 19, datacorresponding to the face area detected by the face detection circuit 14and the surrounding area thereof to the DSPs 52 and 53 (or one of theDSPs 52 and 53) on the basis of the face detection parameters set by theCPU 21, and allows the DSPs 52 and 53 to perform the processing todetect facial parts and generate an evaluation value of the facialexpression.

In step S216, the controller 54 in the programmable signal processingcircuit 15 receives the result of detecting the facial parts and theevaluation value of the facial expression from the DSPs 52 and 53 andoutputs these results to the CPU 21.

In step S217, the CPU 21 generates the final face detection result onthe basis of the face-part detection results and the expressionevaluation value obtained by the programmable signal processing circuit15. The processing in steps S214 to S216 may be performed only in thecase where a face has been detected by the face detection circuit 14.

In step S218, the CPU 21 determines whether to end the face detectionprocess. In the case where the CPU 21 determines not to end the facedetection process, the flow returns to step S211, and the CPU 21 allowsthe face detection circuit 14 to perform the face detection again.

In the above-described second face detection process, the programmablesignal processing circuit 15 detects facial parts in a limited searcharea on the basis of the face-area detection result obtained by the facedetection circuit 14, thereby reducing the processing time of theprogrammable signal processing circuit 15. While maintaining theaccuracy of detecting facial parts, the detection processing becomesfaster. By using information regarding the direction and tilt of a facedetected by the face detection circuit 14 as control parameters for theprogrammable signal processing circuit 15, the detection processing inthe programmable signal processing circuit 15 becomes more efficient andcan be completed more quickly.

In the programmable signal processing circuit 15, which parts to detect,which type of information to use as detection results among, forexample, the position, size, state of the parts, and which expressionsto evaluate on the basis of the detection results can be changed asnecessary by changing control parameters set by the CPU 21 or a programexecuted by the CPU 21. These changes can be made, for example, inaccordance with an imaging mode selected by user operation or can beautomatically made in accordance with an imaging situation.

The programmable signal processing circuit 15 can determine, on thebasis of the state of facial parts, the facial expression such as asmile or a serious face and evaluate the degree of the facialexpression. Such determination and detection results are used tocontrol, under control of the CPU 21, for example, when capturing aportrait photograph of a person, the automatic shutter-release at thetime the facial expression changes to a smile or, when capturing anidentification (ID) photograph, the automatic image capturing at thetime the face is not smiling.

Under control of the CPU 21, whether each person being photographed isblinking or not is determined on the basis of the result of detectingthe state of the eyes, and the shutter can be released automatically atthe time all the persons being photographed are not blinking. On thebasis of the result of detecting the state of the eyes of a person beingphotographed, the direction in which the person is gazing can beestimated, and the shutter can be released at the time the person isgazing at the imaging lens. On the basis of the result of detecting thestate of the eyes, an undesired case where the color of the eyes is notfavorable, such as when the eyes are “red” or light is being reflectedfrom the eyeball, is detected, and the shutter operation can becontrolled, or the color of a captured image can be corrected.

Whether a person being photographed is speaking or not is determined onthe basis of the result of detecting the state of the mouse or lip, and,in the case where the person is speaking, a microphone can beautomatically turned on, or the determination result can be employed tocontrol the shutter operation timing.

Accordingly, various functions of high added values can be included inthe imaging apparatus without changing the internal configuration,thereby implementing a sophisticated product at low cost. A new productcan be placed on a market by flexibly changing the specification of theproduct without changing the basic configuration.

In the second face detection process, as in the above-mentionedflowchart, the face detection by the face detection circuit 14 and theface detection by the programmable signal processing circuit 15 can beperformed in a parallel manner, instead of a serial manner. For example,the face detection circuit 14 performs face detection, and theprogrammable signal processing circuit 15 in turn performs facedetection on an image of the next frame on the basis of the detectionresult obtained by the face detection circuit 14. In this case, at thesame time as the programmable signal processing circuit 15 performs facedetection, the face detection circuit 14 starts performing facedetection on the image of the same frame. Alternatively, if the facedetection circuit 14 can complete face detection more quickly than theprogrammable signal processing circuit 15 can, the face detectioncircuit 14 starts face detection from the next frame onward so that theface detection will be completed by the face detection circuit 14 at thesame time as the face detection performed by the programmable signalprocessing circuit 15 ends. With such processing, the result ofdetecting facial parts can be reliably output on a frame-by-frame basis,and the accuracy of the detection result can thus be improved.

Third Face Detection Process

FIG. 11 is a diagram of the outline of a third face detection process.

In the third face detection process shown in FIG. 11, the face detectioncircuit 14 detects a face on the basis of luminance information of dataof an input image P3 (step S301). In contrast, the programmable signalprocessing circuit 15 detects a face on the basis of informationindicating a skin-color area of the input image P3 (step S302). Forexample, the programmable signal processing circuit 15 detects an areawith the hue of the skin color and detects a face in the detectedskin-color area or an area including the surrounding of the skin-colorarea using a detection algorithm differing from that employed by theface detection circuit 14. Alternatively, the programmable signalprocessing circuit 15 may detect the detected skin-color area as a facearea.

The CPU 21 determines the final face area by additionally taking intoconsideration the detection results obtained by the blocks (step S303),thereby implementing highly accurate face detection. For example, theprocessing speed of the face detection circuit 14 can be improved bydetecting a face using only luminance information. In contrast, errorsor omissions in face detection may occur. In such a case, a face is moreaccurately detected on the basis of detection of a skin-color area,thereby completing the detection result obtained by the face detectioncircuit 14.

In the example shown in FIG. 11, the face detection circuit 14 detects aface area A31, which is mistakenly detected as an area having the samebrightness as the skin color and the same pattern as the skin. However,face detection performed by the programmable signal processing circuit15 proves that the face area A31 has been mistakenly detected, and hencethe face area A31 is finally deleted from the detection result. Theprogrammable signal processing circuit 15 detects a face area A36, butthe face detection circuit 14 has detected no face in an areacorresponding to the face area A36. Because a face in the face area A36is partially hidden by a cap, the face detection circuit 14 has probablyomitted this area in detection. With face detection performed by theprogrammable signal processing circuit 15, such omissions in detectioncan be avoided.

In the above-described example, the weakness of one detection algorithmis compensated for by the detection result obtained by the otherdetection algorithm. Alternatively, the CPU 21 may control the blocks tocompensate for the weakness of the detection algorithms with each other.Further, the CPU 21 may reset face detection parameters for the blockson the basis of the detection results obtained by the blocks so that theface detection can be more efficiently performed.

FIG. 12 is a flowchart of the third face detection process performed inthe imaging apparatus. In step S311, the CPU 21 sets face detectionparameters for the face detection circuit 14.

In step S312, the controller 44 in the face detection circuit 14controls the enlargement/reduction circuit 41, the image memory 42, andthe face detection core 43 on the basis of the face detection parametersset by the CPU 21 to detect a face area on the basis of luminanceinformation in one frame, which is read from the image RAM 19 on aframe-by-frame basis.

After the face detection is completed by the face detection circuit 14,the face detection core 43 outputs the face detection result (e.g., thecoordinates and size of a face area) to the CPU 21 in step S313. In stepS314, the CPU 21 sets face detection parameters for the programmablesignal processing circuit 15 in parallel to the processing in step S311.

In step S315, the controller 54 in the programmable signal processingcircuit 15 transfers image data read from the image RAM 19 to the DSPs52 and 53 (or one of the DSPs 52 and 53) on the basis of the facedetection parameters set by the CPU 21, and allows the DSPs 52 and 53 toperform face detection on the basis of a skin-color area.

As has been described above, the programmable signal processing circuit15 detects, for example, an area with the hue as that of the skin coloron the basis of color components of an input image, and detects a facein the detected skin-color area or an area including the surrounding ofthe skin-color area using a detection algorithm differing from thatemployed by the face detection circuit 14. Alternatively, theprogrammable signal processing circuit 15 may detect a face in the areaon the basis of signal components (e.g., chrominance components)differing from those employed by the face detection circuit 14.

Alternatively, a skin-color area may be detected not by the programmablesignal processing circuit 15, but by a known detection function of thecamera-signal processing circuit 13, for example, to implement the whitebalance adjustment or the like. In this case, the CPU 21 instructs theprogrammable signal processing circuit 15 to regard a skin-color areadetected by this detection function or an area including the surroundingthereof as a face search area.

In step S316, the controller 54 in the programmable signal processingcircuit 15 receives the results of detecting the face area from the DSPs52 and 53 and outputs the results to the CPU 21. In step S317, the CPU21 generates the final face detection result on the basis of thedetection results obtained by the face detection circuit 14 and theprogrammable signal processing circuit 15.

In step S318, the CPU 21 determines whether to end the face detectionprocess. In the case where the CPU 21 determines not to end the facedetection process, the CPU 21 performs the processing in step S319. Instep S319, the CPU recalculates face detection parameters for the facedetection circuit 14 and the programmable signal processing circuit 15on the basis of the face detection results obtained by these blocks.Thereafter, the flow returns to steps S311 and S314, and the CPU 21 setsthe recalculated face detection parameters for the face detectioncircuit 14 and the programmable signal processing circuit 15 and allowsthese blocks to start face detection on the next image.

As has been described above, the face detection by the face detectioncircuit 14 and the face detection by the programmable signal processingcircuit 15 are performed in a parallel manner, and the final detectionresult is obtained by the CPU 21 on the basis of the detection resultsobtained by the face detection circuit 14 and the programmable signalprocessing circuit 15. Accordingly, the weakness of a detectionalgorithm employed in one block or of detection algorithms employed inboth blocks can be compensated for by the processing by the CPU 21,thereby accurately detecting a face area.

In the above-described flowchart, the face detection by the facedetection circuit 14 and the face detection by the programmable signalprocessing circuit 15 are performed once in a parallel manner. In thecase where the face detection by the face detection circuit 14 can becompleted more quickly than by the programmable signal processingcircuit 15, the face detection circuit 14 may perform the face detectionon a plurality of frames while the programmable signal processingcircuit 15 is performing the face detection on one frame. In this case,every time the detection result is output from the face detectioncircuit 14, for example, the CPU 21 generates the final detection resulton the basis of the output detection result and the most-recentdetection result obtained by the programmable signal processing circuit15. With such processing, the result of detecting a face area can bereliably output on a frame-by-frame basis in the case of, for example,recording a moving image, and the accuracy of the detection result canthus be improved.

By recalculating the face detection parameters in step S319, the facedetection performed by the face detection circuit 14 and theprogrammable signal processing circuit 15 becomes more efficient. Forexample, the programmable signal processing circuit 15 outputs, besidesface-area information obtained by the detection, skin-color-areainformation to the CPU 21. For the next predetermined couple of times,for example, the CPU 21 recalculates the face detection parameters forthe programmable signal processing circuit 15 such that only a partialarea of an input image including a skin-color area should serve as aface search range, thereby reducing the processing time of theprogrammable signal processing circuit 15. Such a function may beimplemented not under control of the CPU 21, but by a detection programexecuted by the programmable signal processing circuit 15.

Further, for example, only a partial area including a skin-color areamay be set as a face search range in the face detection circuit 14, andthe face detection parameters may be recalculated such that thedetection accuracy can be improved. In this case, the face detectioncircuit 14 performs face detection on the entirety of an input imageevery certain number of times, and, in the meantime, the face detectioncircuit 14 detects a face only in the search range based on theskin-color area. In the case where, as has been described above, a faceis detected by two processing blocks using different algorithms or aface is detected on the basis of different image components, the overalldetection speed can be increased while improving the detection accuracyby reflecting the detection result obtained by one block in the facedetection performed by the other block.

Alternatively, the face detection performed by the face detectioncircuit 14 and the programmable signal processing circuit 15 in theabove-described procedure and the recalculation of face detectionparameters for the face detection circuit 14 and the programmable signalprocessing circuit 15 may be selectively performed in accordance withthe operation mode set in the imaging apparatus.

For example, in the case of a still-image recording mode, the CPU 21displays an image that has been captured prior to a recording operationon a monitor. When a user is adjusting the angle of view, only the facedetection processing by the face detection circuit 14 in steps S312 andS313 is performed, and AE and AF control is implemented on the basis ofthe detection result. Accordingly, an image can be quickly displayed,though with less detection accuracy, and the power consumption duringthe detection can be suppressed. For example, when a shutter releasebutton is pressed halfway, the face detection processing by theprogrammable signal processing circuit 15 in steps S315 and S316 isperformed in a parallel manner, thereby performing accurate facedetection on the basis of the detection results obtained by the blocks.In the case of a moving-image recording mode, the recalculation of facedetection parameters for the face detection circuit 14 and theprogrammable signal processing circuit 15 in step S319 is performed, forexample, at predetermined time intervals, whereby the face detectionaccuracy can be maintained, while reducing the overall processing load.Accordingly, the image recording can be reliably performed at apredetermined frame rate.

Fourth Face Detection Process

FIG. 13 is a diagram of the outline of a fourth face detection process.

The fourth face detection process is to detect the face of a specificperson or the face of a person with a specific feature in an inputimage. As shown in FIG. 13, the face detection circuit 14 performsgeneral face detection on the entirety of an input image P4 withoutspecifying a person or feature, and outputs the coordinates and size ofa face area and the direction and tilt of a face (step S401). Theprogrammable signal processing circuit 15 detects the face of a specificperson or the face of a person with a specific feature in the inputimage P4 (step S402). In this case, the processing time spent by theprogrammable signal processing circuit 15 to detect a face is reduced bysearching only a face area detected by the face detection circuit 14 oran area including the surrounding of the detected face area.

In the example shown in FIG. 13, the face detection circuit 14 performsthe general face detection to detect face areas A41 to A43 in the inputimage P4. Among the face areas A41 to A43, a face included in the facearea A41 is determined by the programmable signal processing circuit 15as the face of a specific person.

The face detection circuit 14 may detect not only the coordinates andsize of a face, but also the direction and tilt of a face. By settingthese pieces of information as face detection parameters for theprogrammable signal processing circuit 15, the programmable signalprocessing circuit 15 is informed in advance of deviations in direction,tilt, and position of the facial parts, whereby the programmable signalprocessing circuit 15 can detect a face more quickly and accurately.

A specific person or a specific feature of the specific person may beselected by user operation or the like. In this case, as will bedescribed with reference to FIG. 14 below, the programmable signalprocessing circuit 15 selects a face detection database (for example,including a face template or the like) to use in accordance with thespecific person or feature selected. In contrast, the face detectioncircuit 14 only uses a database for general face detection irrespectiveof a specific person or feature thereof.

In the fourth face detection process, as in the first and second facedetection processes, it is preferable that the face detection circuit 14and the programmable signal processing circuit 15 perform face detectionon the basis of data of the same input image P4. In the actualprocessing, however, the programmable signal processing circuit 15 mayperform face detection on an image delayed for one or a few frames withrespect to an image detected by the face detection circuit 14.

FIG. 14 is a flowchart of the fourth face detection process performed inthe imaging apparatus.

In the process shown in FIG. 14, as an exemplary case in which a facewith a specific feature is detected, one of a female face, a baby face,or an Oriental face can be detected in accordance with selection by useroperation.

In step S411, the CPU 21 sets face detection parameters for the facedetection circuit 14. In step S412, the controller 44 in the facedetection circuit 14 controls the enlargement/reduction circuit 41, theimage memory 42, and the face detection core 43 on the basis of the facedetection parameters set by the CPU 21 to perform general face detectionon the basis of one frame of image data, which is sequentially read fromthe image RAM 19 on a frame-by-frame basis.

After the face detection is completed by the face detection circuit 14,the face detection core 43 outputs the face detection result (e.g., thecoordinates and size of a face area, and the direction and tilt of aface) to the CPU 21 in step S413.

In step S414, the CPU 21 determines the type of specific feature thathas been specified by a user to detect a face. In the case where afemale face has been set to be detected, the CPU 21 performs theprocessing in step S415. In the case where a baby face has been set tobe detected, the CPU 21 performs the processing in step S418. In thecase where an Oriental face has been set to be detected, the CPU 21performs the processing in step S421.

In step S415, the CPU 21 sets face detection parameters for detecting afemale face in the programmable signal processing circuit 15. In thiscase, for example, the face detection parameters instruct theprogrammable signal processing circuit 15 to regard only a face areadetected by the face detection circuit 14 and an area including thesurrounding thereof as a face search range. At the same time, theprogrammable signal processing circuit 15 is informed of informationregarding the direction and tilt of a face. Further, a database forfemale-face detection is set. In this database, for example, informationregarding a feature point of a female face or the like is recorded.

In step S416, the controller 54 in the programmable signal processingcircuit 15 controls the DSPs 52 and 53 to perform face detection usingthe database for female-face detection on the basis of the facedetection parameters set by the CPU 21.

In step S417, the controller 54 in the programmable signal processingcircuit 15 receives the face detection results from the DSPs 52 and 53and outputs the results to the CPU 21. The processing in steps S418 toS420 is substantially the same as the processing in steps S415 to S417,respectively. The difference is that, in step S418, the CPU 21 sets adatabase for baby-face detection in the programmable signal processingcircuit 15 on the basis of the face detection parameters, and, in stepS419, the programmable signal processing circuit 15 performs facedetection using this database.

The processing in steps S421 to S423 is substantially the same as theprocessing in steps S415 to S417, respectively. The difference is that,in step S421, the CPU 21 sets a database for Oriental-face detection inthe programmable signal processing circuit 15 on the basis of the facedetection parameters, and, in step S422, the programmable signalprocessing circuit 15 performs face detection using this database.

In steps S415 to S423 described above, for example, databases focused ondetecting the face of, for example, females, babies, and Orientals areloaded in advance in the RAM 51 of the programmable signal processingcircuit 15, and, on the basis of the face detection parameters, the CPU21 instructs the programmable signal processing circuit 15 as to whichdatabase to use. Alternatively, a face detection database in accordancewith user selection may be read from the EEPROM 22 by the processing bythe CPU 21 and loaded into the programmable signal processing circuit15. Alternatively, not only a face detection database in accordance withuser selection may be simply selected, but also a different facedetection program for each facial feature to be detected may be executedby the programmable signal processing circuit 15.

In step S424, the CPU 21 generates the final detection result (e.g., thecoordinates and size of a face) on the basis of the face detectionresult obtained by the programmable signal processing circuit 15. Theprocessing in steps S414 to S424 may be implemented only in the casewhere a face has been detected by the face detection circuit 14.

In step S425, the CPU 21 determines whether to end the face detectionprocess. In the case where the CPU 21 determines not to end the facedetection process, the CPU 21 performs the processing in step S426. Instep S426, the CPU 21 recalculates face detection parameters for theface detection circuit 14 on the basis of the face detection resultobtained by the programmable signal processing circuit 15. Thereafter,the flow returns to step S411, and the CPU 21 sets the recalculated facedetection parameters for the face detection circuit 14 and allows theface detection circuit 14 to start face detection on the next image. Inone of steps S415, 418, and S421 thereafter, the CPU 21 sets the facedetection parameters recalculated in step S416 in the programmablesignal processing circuit 15.

Since the search range is limited in the programmable signal processingcircuit 15 to detect a face on the basis of the face-area detectionresult obtained by the face detection circuit 14 in the fourth facedetection process, the processing time of the programmable signalprocessing circuit 15 is reduced, thereby completing the detectionprocess more quickly while maintaining the face detection accuracy. Inparticular, since more detailed detection is performed by theprogrammable signal processing circuit 15 in an area in which a face hasalready been determined by the face detection circuit 14 to exit, moreaccurate face detection can be implemented without increasing theprocessing load.

In the programmable signal processing circuit 15, a person or a facialfeature to be detected can be changed in accordance with user setting.The functionality of the imaging apparatus can be enhanced withoutchanging the internal configuration. The same basic circuitconfiguration can be applied to various products with differentspecifications. Accordingly, the developing and production cost of manyproducts can be reduced.

Although the face detection by the face detection circuit 14 and theface detection by the programmable signal processing circuit 15 areperformed in a serial manner in the fourth detection process as in theabove-described flowchart, they can be done in a parallel manner. Forexample, the face detection circuit 14 starts performing face detection,and the programmable signal processing circuit 15 performs facedetection on an image of the next frame on the basis of the detectionresult obtained by the face detection circuit 14. In this case, at thesame time as the programmable signal processing circuit 15 performs facedetection, the face detection circuit 14 starts face detection on theimage of the same frame. Alternatively, if the face detection circuit 14can complete face detection more quickly than the programmable signalprocessing circuit 15 can, the face detection circuit 14 starts facedetection on the next frame onward so that the face detection will becompleted by the face detection circuit 14 at the same time as the facedetection performed by the programmable signal processing circuit 15ends. With such processing, the result of detecting the face of aspecific person or the face of a person with a specific feature can bereliably output on a frame-by-frame basis, and the accuracy of thedetection result can thus be improved.

Other Embodiments

FIG. 15 is a block diagram of the configuration of an imagerecording/reproducing apparatus according to another embodiment of thepresent invention. In FIG. 15, the same reference numerals are used todenote the same blocks as those shown in FIG. 1.

The present invention is applicable not only to the above-describedimaging apparatus, but also to an image recording/reproducing apparatushaving no imaging function, as shown in FIG. 15. The imagerecording/reproducing apparatus is implemented as, for example, a videorecorder. In this case, moving image data obtained from a receptionsignal of a television broadcast or the like is input via the image bus20 to the image compression/decompression circuit 17 to becompressed/encoded and stored as a moving image file in the storage unit18. Such a moving image file is read from the storage unit 18 anddecompressed/decoded by the image compression/decompression circuit 17.Thereafter, an image processing circuit 25 applies, for example, variousimage-quality correction processes to the decompressed/decoded data andoutputs the result to the display processing circuit 16, therebydisplaying an image-quality-corrected reproduced image on a monitor (notshown).

At the time of reproducing a moving image, decompressed/decoded imagedata is supplied via the image RAM to the face detection circuit 14 andthe programmable signal processing circuit 15, and a face can bedetected in a reproduced image with the above-described face detectionprocedures. The face detection result can be used, for example, by theimage processing circuit 25 to correct the color of the entire imagesuch that the color of a detected face portion can become moreappropriate.

As in the face detection procedures described above, the face detectioncan be performed quickly and accurately even in the imagerecording/reproducing apparatus. The detection procedure and setting canbe flexibly changed in the programmable signal processing circuit 15 inaccordance with the intended use of the face detection result, thenecessary detection accuracy, detection information, and the like.

Although the apparatus in which, for example, an image can be recordedon a storage medium has been described above, the present invention isalso applicable to a video player configured to reproduce image datastored in, for example, a portable storage medium. The present inventionis also applicable to a reproducing apparatus configured to reproduce animage file which has been captured by another imaging device or receivedvia a network and temporarily accumulated in the storage unit 18.Further, the present invention is applicable to a printer configured toprint an image reproduced from an image file supplied from anotherdevice.

It should be understood by those skilled in the art that variousmodifications, combinations, sub-combinations and alterations may occurdepending on design requirements and other factors insofar as they arewithin the scope of the appended claims or the equivalents thereof.

1. An image processing apparatus, comprising: a face detection circuitincluding a dedicated hardware circuit configured to detect a face in aninput image; a signal processing circuit configured to perform signalprocessing based on an input image signal in accordance with a programincluding a face detection program for detecting a face in an inputimage; and a controller configured to control face detection by thesignal processing circuit on the basis of a face detection resultobtained by the face detection circuit.
 2. The image processingapparatus according to claim 1, wherein the face detection circuitdetects a face in the entirety of an input image, wherein the controllersets a partial area of an image, the partial area including a face areadetected by the face detection circuit, as a face detection area in thesignal processing circuit, and wherein the signal processing circuitdetects a face only in the face detection area of the input image set bythe controller.
 3. The image processing apparatus according to claim 2,wherein the signal processing circuit performs face detection such thatthe position and size of a face area can be detected more accuratelythan by the face detection circuit.
 4. The image processing apparatusaccording to claim 2, wherein the face detection circuit performs facedetection focused on avoiding omissions in face detection, and whereinthe signal processing circuit performs face detection focused onavoiding errors in face detection.
 5. The image processing apparatusaccording to claim 2, wherein the controller resets a parameter forcontrolling the face detection operation of the face detection circuiton a next input image on the basis of a face detection result obtainedby the signal processing circuit.
 6. The image processing apparatusaccording to claim 2, wherein the signal processing circuit detects theposition of a facial part in the face detection area of the input imageset by the controller.
 7. The image processing apparatus according toclaim 6, wherein the signal processing circuit detects the state of thefacial part detected in the face detection area.
 8. The image processingapparatus according to claim 7, wherein the signal processing circuitdetermines a facial expression on the basis of the state of the facialpart detected in the face detection area.
 9. The image processingapparatus according to claim 2, wherein the face detection circuitperforms general face detection, and wherein the signal processingcircuit performs detection of the face of a specific person.
 10. Theimage processing apparatus according to claim 9, wherein the signalprocessing circuit detects the face of a specific person to be detectedusing feature-point information regarding the face of the specificperson, and, under control of the controller, changes the feature-pointinformation used, thereby changing the specific person to be detected.11. The image processing apparatus according to claim 2, wherein theface detection circuit performs general face detection, and wherein thesignal processing circuit performs detection of a face with a specificfeature.
 12. The image processing apparatus according to claim 11,wherein the signal processing circuits uses feature-point informationregarding a face with a specific feature to be detected to detect theface, and, under control of the controller, changes the feature-pointinformation used, thereby changing the specific feature of the person tobe detected.
 13. The image processing apparatus according to claim 1,wherein the controller allows the face detection circuit to startperforming face detection on a next input image while the signalprocessing circuit is performing face detection.
 14. The imageprocessing apparatus according to claim 1, wherein the controller allowsthe face detection circuit to perform face detection on a plurality ofconsecutive input images while the signal processing circuit isperforming face detection on one input image on the basis of amost-recent face detection result obtained by the face detectioncircuit, the controller outputs a face detection result obtained by theface detection circuit as a final detection result, and the controllercorrects the face detection result obtained by the face detectioncircuit on the basis of a most-recent face detection result obtained bythe signal processing circuit.
 15. The image processing apparatusaccording to claim 1, wherein the controller selectively outputs one ofa face detection result obtained by the face detection circuit and aface detection result obtained by the signal processing circuit as afinal face detection result as necessary, and, in the case where theface detection result obtained by the face detection circuit is outputas the final detection result, the controller stops face detectionperformed by the signal processing circuit.
 16. An image processingmethod, comprising: detecting a face in an input image by a facedetection circuit including a dedicated hardware circuit configured toperform face detection; using a signal processing circuit to performsignal processing based on an input image signal in accordance with aprogram including a face detection program for detecting a face in aninput image; and controlling face detection by the signal processingcircuit on the basis of a face detection result obtained by the facedetection circuit.